//
//  VerifyView.m
//  YTwallet
//
//  Created by ZhangLin on 2019/3/19.
//  Copyright © 2019年 hadrlog. All rights reserved.
//

#import "VerifyView.h"
#import <Masonry.h>
@implementation VerifyView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self setupViews];
    }
    return self;
}

-(void)setupViews{
    
    self.backgroundColor = [UIColor colorWithRed:242 / 255.0 green:244 / 255.0 blue:246 / 255.0 alpha:1];
    
    self.topView = [[UIView alloc] init];
    self.topView.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.topView];
    [self.topView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.top.mas_equalTo(0);
        make.height.mas_equalTo(112);
    }];
    
    self.phoneLab = [[UILabel alloc] init];
    self.phoneLab.text = @"您当前手机号";
    self.phoneLab.font = [UIFont systemFontOfSize:14];
    self.phoneLab.textColor = [UIColor colorWithRed:153 / 255.0 green:153 / 255.0 blue:153 / 255.0 alpha:1];
    [self.topView addSubview:self.phoneLab];
    [self.phoneLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.top.mas_equalTo(30);
    }];
    
    self.phoneNumLab = [[UILabel alloc] init];
    self.phoneNumLab.text = @"136****1229";
    self.phoneNumLab.font = [UIFont systemFontOfSize:22];
    self.phoneNumLab.textColor = [UIColor colorWithRed:51 / 255.0 green:51 / 255.0 blue:51 / 255.0 alpha:1];
    [self.topView addSubview:self.phoneNumLab];
    [self.phoneNumLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.top.equalTo(self.phoneLab.mas_bottom).offset(5);
    }];
    
    self.midView = [[UIView alloc] init];
    self.midView.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.midView];
    [self.midView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.top.equalTo(self.topView.mas_bottom).offset(20);
        make.height.mas_equalTo(54);
    }];
    
    self.loginPwdLab = [[UILabel alloc] init];
    self.loginPwdLab.text = @"登录密码";
    self.loginPwdLab.font = [UIFont systemFontOfSize:16];
    self.loginPwdLab.textColor = [UIColor colorWithRed:102 / 255.0 green:102 / 255.0 blue:102 / 255.0 alpha:1];
    [self.midView addSubview:self.loginPwdLab];
    [self.loginPwdLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.centerY.equalTo(self.midView);
        make.width.mas_equalTo(70);
    }];
    
    self.loginPwdTf = [[UITextField alloc] init];
    self.loginPwdTf.placeholder = @"输入您的登录密码";
    self.loginPwdTf.clearButtonMode = UITextFieldViewModeWhileEditing;
    self.loginPwdTf.secureTextEntry = YES;
    [self.midView addSubview:self.loginPwdTf];
    [self.loginPwdTf mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.loginPwdLab.mas_right).offset(20);
        make.centerY.equalTo(self.midView);
        make.right.mas_equalTo(-15);
    }];
    
    self.loginBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    [self.loginBtn setTitle:@"登录" forState:(UIControlStateNormal)];
    [self.loginBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
    self.loginBtn.backgroundColor = [UIColor colorWithRed:219 / 255.0 green:224 / 255.0 blue:255 / 255.0 alpha:1];
    self.loginBtn.layer.cornerRadius = 22;
    [self addSubview:self.loginBtn];
    [self.loginBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.right.mas_equalTo(-15);
        make.height.mas_equalTo(44);
        make.top.equalTo(self.midView.mas_bottom).offset(40);
    }];
    
}

@end
